package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.AccountDeal;
import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.zhf.shop.mapper.AccountDealTitleMapper;
import cn.zhf.shop.entity.AccountDealTitle;
import cn.zhf.shop.service.AccountDealTitleService;

import java.util.List;

@Service
public class AccountDealTitleServiceImpl implements AccountDealTitleService {

    @Resource
    private AccountDealTitleMapper accountDealTitleMapper;

    @Override
    public Message deleteByPrimaryKey(Integer accountDealTitleId) {
        return accountDealTitleMapper.deleteByPrimaryKey(accountDealTitleId)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(AccountDealTitle record) {
        return accountDealTitleMapper.insert(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insertSelective(AccountDealTitle record) {
        return accountDealTitleMapper.insertSelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer accountDealTitleId) {
        return Message.success(null).add(accountDealTitleMapper.selectByPrimaryKey(accountDealTitleId));
    }

    @Override
    public Message updateByPrimaryKeySelective(AccountDealTitle record) {
        return accountDealTitleMapper.updateByPrimaryKeySelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(AccountDealTitle record) {
        return accountDealTitleMapper.updateByPrimaryKey(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message<List<AccountDeal>>  selectByAll() {
        return Message.success(null).add(accountDealTitleMapper.selectByAll());
    }

    @Override
    public Message<List<AccountDeal>> selectByUpdateTime(String updateTime) {
        return Message.success(null).add(accountDealTitleMapper.selectByUpdateTime(updateTime));
    }

}

